package com.gdth.widget.listview.refresh;

import com.gdth.R;

import android.content.Context;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;

public class FooterView extends View{
	private Context mContext;

	private TextView noData;
	private TextView loadFull;
	private TextView more;
	private ProgressBar loading;
	
	private int layout_footer = R.layout.aron_listview_footer;
	
	
	public FooterView(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
		
		this.mContext = context;
	}

	public void init(){
		inflate(this.mContext, layout_footer, null);
		
		loadFull = (TextView) this.findViewById(R.id.loadFull);
		noData = (TextView) this.findViewById(R.id.noData);
		more = (TextView) this.findViewById(R.id.more);
		loading = (ProgressBar) this.findViewById(R.id.loading);
	}
	
	public void setStateByFirst(){
		loadFull.setVisibility(View.GONE);
		loading.setVisibility(View.GONE);
		more.setVisibility(View.GONE);
		noData.setVisibility(View.VISIBLE);
	}
	
	public void setStateByMiddle(){
		loadFull.setVisibility(View.VISIBLE);
		loading.setVisibility(View.GONE);
		more.setVisibility(View.GONE);
		noData.setVisibility(View.GONE);
	}
	
	public void setStateByLast(){
		loadFull.setVisibility(View.GONE);
		loading.setVisibility(View.VISIBLE);
		more.setVisibility(View.VISIBLE);
		noData.setVisibility(View.GONE);
	}
}
